You are here: Tips and Tricks > Run queries to fix issues on remote servers

Run queries to fix issues on remote servers

You can use SQLdm Mobile to run custom, ad-hoc queries on remote SQL Server instances.SQLdm Mobile also provides several default query templates that, when run, perform common administrative tasks on the target database.

For custom queries that you run frequently in your environment, you can save that query as a template to rerun later. All query templates can be used by any SQLdm Mobile user. Creating query templates also lets your team easily use approved queries that have been tested and optimized for your environment.

Run a query

To run a query, specify the following parameters, and then tap Run Query.

When can I run a query?

You can access the Run Query feature from the action menu on any server view in SQLdm Mobile, letting you immediately address a performance issue or resolve an alert.

Does SQLdm Mobile log the queries that are run against monitored servers?

Yes. SQLdm records every query you run in the application event log. Each log entry includes:

Can I use the GO keyword in my query?

Yes. The GO keyword is supported by the Run Query feature.

What is a query template?

A query template is a T-SQL script saved to the SQLdm Mobile Repository. You can use the default query template to get started, and then later save your own query templates for customized troubleshooting and issue resolution.

SQLdm Mobile provides this default template:

Template name What it does
Backup History Checks when the most recent backup occurred on each database hosted by the selected SQL Server instance, and then calculates how many days have passed since that operation was run. Both values are returned, along with the name of the corresponding database.

How do I create a query template?

You can save your own query template that contains a T-SQL script you frequently use.

  1. Type the appropriate T-SQL code into the query text box.
  2. Tap the Template pull-down menu, and then tap the Save As template option.
  3. Type a new name, and then tap Save.

Can I delete a template I no longer need?

Yes. Use the Template pull-down menu to select the template you want to delete, and then tap the Delete template option.

< < Close Help